//
//  LYSelectedSubjectCollectionCell.m
//  artist
//
//  Created by laotang on 16/4/18.
//  Copyright © 2016年 viviyoo. All rights reserved.
//

#import "LYSelectedSubjectCollectionCell.h"
@interface LYSelectedSubjectCollectionCell()
@property (nonatomic, strong) UIButton *classesTitleButton;
@end
@implementation LYSelectedSubjectCollectionCell
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if(self){
        self.classesTitleButton = [[UIButton alloc] initWithFrame:self.bounds];
        [self.classesTitleButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
        [self.classesTitleButton setTitleColor:LYColorWithHex(0x00abee) forState:UIControlStateSelected];
        [self.classesTitleButton addTarget:self action:@selector(buttonDidPress:) forControlEvents:UIControlEventTouchUpInside];
        [self.contentView addSubview:self.classesTitleButton];
        self.classesTitleButton.userInteractionEnabled = NO;
    }
    
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.classesTitleButton.frame = self.bounds;
}
- (void)setTitle:(NSString *)title{
    [self.classesTitleButton setTitle:title forState:UIControlStateNormal];
    
}

- (void)buttonDidPress:(UIButton *)button{
    
    button.selected = !button.selected;
    
    if (button.selected){
        
    }else{
        
    }
}
@end
